package com.qcby.train.mybaitsplusdemo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qcby.train.mybaitsplusdemo.entity.ClassInfo;
import com.qcby.train.mybaitsplusdemo.entity.Student;
import com.qcby.train.mybaitsplusdemo.model.ResultJson;
import com.qcby.train.mybaitsplusdemo.service.IClassInfoService;
import com.qcby.train.mybaitsplusdemo.vo.ClassInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: ClassInfoController
 * @description:
 * @author: lxt
 * @create: 2021-04-26 20:38
 **/
@RestController
@RequestMapping("rest/classInfo")
public class RestClassInfoController {

    @Autowired
    private IClassInfoService classInfoService;

    @RequestMapping("listPage")
    public ResultJson listPage3(int pageNo, int pageSize, ClassInfo classInfo){
        Page<ClassInfoVo> page = new Page<>(pageNo,pageSize);
        IPage<ClassInfoVo> pageInfo = classInfoService.listPage(page,classInfo);
        return ResultJson.ok(pageInfo);
    }
}
